<template>
  <div class="authentication">
    <div class="authentication-logo">
      <img src="../../assets/椭圆 1.png" alt="" />
    </div>
    <div class="authentication-title">
      <span class="authentication-top">签署成功</span>
      <span>签署完成进度: ({{ list.progressFraction }})</span>
      <van-button type="info" block @click="$router.push('/layout')"
        >返回至首页</van-button
      >
      <van-button type="default" block @click="toFilt">查看文件详情</van-button>
      <span class="span-authentication"
        >文件签署完成后，请前往文件详情或电脑端下载文件</span
      >
    </div>
  </div>
</template>

<script>
import { addContractCompleteness } from '@/api/contract'
export default {
  data() {
    return {
      list: {}
    }
  },
  created() {
    this.infoData()
  },
  mounted() {},
  methods: {
    async infoData() {
      try {
        const { data: res } = await addContractCompleteness({
          contractId: this.$route.params.contractId
        })
        console.log(res)
        if (res.code !== '0') {
          return this.$toast.fail('获取合同失败')
        }
        this.list = res.data
      } catch (error) {
        console.log(error)
      }
    },
    toFilt() {
      this.$router.push({
        name: 'look-over',
        params: { contractId: this.$route.params.contractId }
      })
    }
  }
}
</script>

<style scoped lang="less">
.authentication {
  // logo
  .authentication-logo {
    box-sizing: border-box;
    height: 358px;
    text-align: center;
    padding-top: 208px;
    img {
      height: 150px;
    }
  }
  // title
  .authentication-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 40px;
    .authentication-top {
      margin: 60px 0 40px 0;
      font-size: 40px;
    }
    span:nth-child(2) {
      font-size: 28px;
      color: #666666;
      margin-bottom: 60px;
    }
    /deep/.van-button--normal {
      height: 96px;
      margin-bottom: 24px;
      font-size: 34px;
      line-height: 96px;
    }
    .span-authentication {
      font-size: 24px;
      color: #999999;
    }
  }
}
</style>
